package enchere.ihm.controlleur;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import enchere.EnchereRemote;
import enchere.ihm.vue.ArticleCreation;
import enchere.ihm.vue.MenuEncheres;

public class MenuControlleur {
	
	private MenuEncheres menuEncheres;
	private EnchereRemote enchereRemote;

	public MenuControlleur(MenuEncheres menuEncheres) throws NamingException {
		this.menuEncheres = menuEncheres;
		Context ctx = new InitialContext();
		enchereRemote = (EnchereRemote) ctx.lookup(EnchereRemote.class.getName());
	}

	public void goToNewArticle() {
		menuEncheres.setVisible(false);
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new ArticleCreation().setVisible(true);
	        }
	     });
		//TODO : go to new article
	}

}
